<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <div class="box" id="root"></div>
    <script>

        var root = document.getElementById('root');
        root.id = 'roots';
        console.log(root.id)

        root.className = 'boxs box1';

        root.classList.add('box2')
        console.log(root.className)


    </script>
</body>
</html>